package com.alphaking.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

import javax.servlet.http.HttpServletRequest;

import com.alibaba.druid.pool.DruidDataSource;

public class DeploymentUtil {
	
	public static String TITLE = "生活邦荟";
	private static String PROJECT_NAME = "alphaking";
	private static String ONLINE_SERVERNAME = "test4.productshow.cn";
	
	private static String TEST_SERVERNAME = "localhost";
	private static int TEST_SERVERPORT = 80;
	
	
	public static String getBasePath(){
		String baseUrl = "";
		if(isDebug()){
			baseUrl = "http://"+TEST_SERVERNAME;
			if(TEST_SERVERPORT!=80){
				baseUrl = baseUrl +":"+TEST_SERVERPORT;
			}
		}else{
			baseUrl = "http://"+ONLINE_SERVERNAME;
		}
		baseUrl = baseUrl + "/" + PROJECT_NAME;
		return baseUrl;
	}
	
	public static boolean isDebug(){
		if(ONLINE_SERVERNAME.equals(TEST_SERVERNAME)){
			return false;
		}
		return true;
	}
	
	public static void main(String[] args) throws UnknownHostException{
		InetAddress addr = InetAddress.getLocalHost();
		System.out.println(addr.getHostAddress().toString());
	}
}
